# encoding: utf-8
"""
Serialization schemas for VCloud resources RESTful API
----------------------------------------------------
"""

from flask_marshmallow import base_fields
from flask_restplus_patched import Schema
from flask_restplus_patched import ModelSchema

from .models import VCloud


class BaseVCloudSchema(Schema):
    """
    Base team schema exposes only the most general fields.
    """

    class Meta:
        # pylint: disable=missing-docstring
        model = VCloud
        fields = (
            'ipaddress',
            'hostname',
            'status',
            'cpu_cores',
            'cpu_free',
            'memory',
            'disk',
            'memory_free',
            'disk_free',
            'disk_free_list',
        )


class BaseTestSchema(Schema):
    class Meta:
        # pylint: disable=missing-docstring
        fields = (
            'ipaddress',
            'hostname',
            'data',
        )


class HeathCheckSchema(Schema):
    """
    Base team schema exposes only the most general fields.
    """

    class Meta:
        # pylint: disable=missing-docstring
        model = VCloud
        fields = (
            'nas_available',
            'beetle_mount_available',
            'svn_config_available',
            'oracle_instance_available',
            'mysql_instance_available',
            'cassandra_instance_available',
            'mongodb_instance_available',
            'rabbitmq_instance_available',
            'Redis_instance_available',
            'disk_free_list',
        )
